package com.stlm2.dems.informs.entity.base;

import com.stlm2.dems.informs.entity.InformsState;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by ZLQ on 2017/5/30.
 */
public class BaseInforms  implements Serializable {
    //ID主键
    private  int id;
    //标题
    private  String title;
    //内容
    private String content;
    //创建时间
    private Date createTime;
    //创建人
    private  int createUserId;
    //状态
    private InformsState state;
    //公告图标
    private String imgUrl;
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(int createUserId) {
        this.createUserId = createUserId;
    }

    public InformsState getState() {
        return state;
    }

    public void setState(InformsState state) {
        this.state = state;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    /**
     * 映射：状态
     */
    public Integer getStateValue() {
        return (state != null) ? state.getIntValue() : null;
    }

    public void setStateValue(Integer value) {
        if (value != null)
            this.state = InformsState.getByIntValue(value);
    }
}
